-- GENERATED SPELL FOR [Westguard Defender] --


function spell0_23842(pUnit, Event) --@Defensive Stance,Self--
pUnit:FullCastSpellOnTarget(7164,pUnit)
pUnit:RegisterEvent('Sorts_23842', 601, 1)
end

function spell1_23842(pUnit, Event) --@Improved Blocking,Self--
pUnit:FullCastSpellOnTarget(3639,pUnit)
pUnit:RegisterEvent('Sorts_23842', 6283, 1)
end

function spell2_23842(pUnit, Event) --@Shield Bash,n/a--
pUnit:FullCastSpellOnTarget(11972,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23842', 8270, 1)
end

function Sorts_23842(pUnit, Event)
local choix_sorts_23842 = math.random(0, 2)
if choix_sorts_23842 == 0 then
pUnit:RegisterEvent('spell0_23842', 1, 1)
end
if choix_sorts_23842 == 1 then
pUnit:RegisterEvent('spell1_23842', 1, 1)
end
if choix_sorts_23842 == 2 then
pUnit:RegisterEvent('spell2_23842', 1, 1)
end
end

function mob23842_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23842', math.random(1500, 3000), 1)
end

function mob23842_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23842_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23842_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23842, 1, 'mob23842_Action')
RegisterUnitEvent(23842, 2, 'mob23842_Leave')
RegisterUnitEvent(23842, 3, 'mob23842_Kill')
RegisterUnitEvent(23842, 4, 'mob23842_Die')
